from selenium.webdriver.common.by import By
import pytest, time


class UserProductPurchaseLocator:
    """
         my resource 页面
    """
    # my resource tab页面菜单列表
    my_resource_tab_list = (By.CSS_SELECTOR, '[class="antd4-tabs-tab-btn"]')
    # product 列表
    my_resource_product_list = (By.CSS_SELECTOR, '[class="productBtn___2kdzl"]')
    # create_new按钮
    move_storge_create_new = (By.XPATH, '(//button[@class="antd4-btn antd4-btn-primary"])[3]')

    # 进入My Resource菜单
    my_resource_menu = (By.CSS_SELECTOR, '[path="/work_bench/myResource"]')
    # resources
    resources = (By.CSS_SELECTOR, '[class="antd4-tabs-tab-btn"]')

    # prod_list
    prod_list = (By.XPATH, '//div[@class="antd4-popover popover-contain___1wdXb antd4-popover-placement-bottomLeft "]/div/div[2]//div[contains(@class,"productBtn")]')
    # security_page
    security_page = (By.CSS_SELECTOR, '[class="antd4-tabs-nav"]')
    # ECS 的Create New按钮
    ecs_createnew_button = (By.XPATH, '//*[@id="rc-tabs-1-panel-253"]/div/div/div/form/div[1]/div/div/div/div/button/span[1]')
    # NAS 的Create New按钮
    nas_createnew_button = (By.XPATH, '//*[@id="rc-tabs-1-panel-259"]/div/div/div/form/div[1]/div/div/div/div/button/span[1]')
    # OSS 的Create New按钮
    oss_createnew_button = (By.XPATH, '//*[@id="rc-tabs-1-panel-259"]/div/div/div/form/div[1]/div/div/div/div/button/span[1]')
    # WAF 的Create New按钮
    waf_createnew_button = (By.XPATH, '//*[@id="rc-tabs-1-panel-451"]/div/div/div/form/div[1]/div/div/div/div/button/span[1]')

    # ifarme
    iframe = (By.CSS_SELECTOR, '[id="hj_container"]')
    # 用于检查Web Application Firewall文本
    check_waf_page = (By.XPATH, '(//div[@class="antd4-space-item"])[1]/div')
    # Elastic Compute Service购买页
    ecs_purchase_page = (By.CSS_SELECTOR, '[class="cre-page-container-default-content"]')
    # ECS页的Billing Method & Region区标题
    ecs_billing_methon_region_tittle = (By.XPATH, '(//*[@id="creForm"]/div[1]/div[1]/div[2])')
    # Billing Method按钮标题
    ecs_billing_methon_tittle = (By.CSS_SELECTOR, '[for="creForm_billingMethod"]')
    # Region按钮标题
    ecs_region_tittle = (By.XPATH, '//*[@id="creForm"]/div/div[2]/div[2]/div/label')
    # Zone按钮标题
    ecs_zone_tittle = (By.CSS_SELECTOR, '[for="creForm_zoneId"]')
    # Organization按钮标题
    ecs_organization_tittle = (By.CSS_SELECTOR, '[for="creForm_orgCode"]')
    # ECS页的Instance & Images区标题
    ecs_instance_images_tittle = (By.XPATH, '(//*[@id="creForm"]/div[2]/div[1]/div[2])')
    # Instance Name按钮标题
    ecs_instance_name_tittle = (By.CSS_SELECTOR, '[for="creForm_instanceName"]')
    # Instance Type按钮标题
    ecs_instance_type_tittle = (By.CSS_SELECTOR, '[for="creForm_instanceType"]')
    # Image Type按钮标题
    ecs_image_type_tittle = (By.XPATH, '//*[@id="creForm"]/div[2]/div[2]/div[3]/div/label')
    # Image按钮标题
    ecs_image_tittle = (By.CSS_SELECTOR, '[for="creForm_image"]')
    # Deployment Set按钮标题
    ecs_deployment_set_tittle = (By.CSS_SELECTOR, '[for="creForm_deploymentSetId"]')
    # ECS页的Storage区标题
    ecs_storage_tittle = (By.XPATH, '(//*[@id="creForm"]/div[3]/div[1]/div[2])')
    # Storage按钮标题
    ecs_storage_button_tittle = (By.XPATH, '(//*[@for="creForm_storage"]/div/div/div)')
    # System Disk按钮标题
    ecs_system_disk_tittle = (By.CSS_SELECTOR, '[for="creForm_storage_systemDisk"]')
    # Snapshot Policy按钮标题
    ecs_snapshot_policy_tittle = (By.CSS_SELECTOR, '[for="creForm_snapshotPolicyId"]')
    # ECS页的Network区标题
    ecs_network_tittle = (By.XPATH, '(//*[@id="creForm"]/div[4]/div[1]/div[2])')
    # VPC&VSwitch按钮标题
    ecs_cpv_vswitch_tittle = (By.XPATH, '(//*[@for="creForm_vpcs"]/div/div/div)')
    ecs_cpv_vswitch_tittle1 = (By.XPATH, '(//*[@id="creForm"]/div[1]/div[2]/div[4]/div/label)')
    # Elastic IP Addresses按钮标题
    ecs_elastic_ip_addresses_tittle = (By.XPATH, '(//*[@for="creForm_publicIpAddress"]/div/div[1]/div)')
    # ECS页的Security区标题
    ecs_security_tittle = (By.XPATH, '(//*[@id="creForm"]/div[5]/div[1]/div[2])')
    # Security Group按钮标题
    ecs_security_group_tittle = (By.CSS_SELECTOR, '[for="creForm_securityGroupId"]')
    # Logon Credential按钮标题
    ecs_logon_credential_tittle = (By.CSS_SELECTOR, '[for="creForm_passwordSetting"]')
    # Key Pair按钮标题
    ecs_key_pair_tittle = (By.CSS_SELECTOR, '[for="creForm_keyPairName"]')
    # ECS页的Order Setting区标题
    ecs_order_setting_tittle = (By.XPATH, '(//*[@id="creForm"]/div[6]/div[1]/div[2])')
    # Validity Period按钮标题
    ecs_validity_period_tittle = (By.CSS_SELECTOR, '[for="creForm_period"]')
    # Quantity按钮标题
    ecs_quantity_tittle = (By.CSS_SELECTOR, '[for="creForm_quantity"]')
    # Enable Auto-renewal按钮标题
    ecs_enable_auto_renewal_tittle = (By.XPATH, '(//*[@for="creForm_autoRenewalFlag"]/div/div/div)')

    # NAS File System购买页
    nas_purchase_page = (By.CSS_SELECTOR, '[class="cre-page-container-default-content"]')
    # NAS页的Region区标题
    nas_region_tittle = (By.XPATH, '(//*[@id="creForm"]/div[1]/div[1]/div[2])')
    # NAS页的Region按钮标题
    nas_region_btn_tittle = (By.XPATH, '//*[@class="antd4-row antd4-form-item cre-schema-group"]/div/label/div')
    # NAS页的Resource区标题
    nas_resource_tittle = (By.XPATH, '(//*[@id="creForm"]/div[2]/div[1]/div[2])')
    # NAS页的Resource Plan Type区按钮标题
    nas_resource_plan_type_btn_tittle = (By.CSS_SELECTOR, '[for="creForm_resourcePlanType"]')
    # NAS页的Capacity按钮标题
    nas_capacity_btn_tittle = (By.CSS_SELECTOR, '[for="creForm_capacity"]')
    # NAS页的Order Setting区标题
    nas_order_setting_tittle = (By.XPATH, '(//*[@id="creForm"]/div[3]/div[1]/div[2])')
    # NAS页的Validity Period区按钮标题
    nas_validity_period_btn_tittle = (By.CSS_SELECTOR, '[for="creForm_period"]')
    # NAS页的Enable Auto-renewal按钮标题
    nas_enable_auto_renewal_btn_tittle = (By.XPATH, '(//*[@for="creForm_autoRenewalFlag"]/div/div[1]/div)')

    # Object Storage Service购买页
    oss_purchase_page = (By.CSS_SELECTOR, '[class="cre-page-container-default-content"]')
    # OSS页的Region区标题
    oss_region_tittle = (By.XPATH, '(//*[@id="creForm"]/div[1]/div[1]/div[2])')
    # OSS页的Region按钮标题
    oss_region_btn_tittle = (By.XPATH, '//*[@class="antd4-row antd4-form-item cre-schema-group"]/div/label/div')
    # OSS页的Resource区标题
    oss_resource_tittle = (By.XPATH, '(//*[@id="creForm"]/div[2]/div[1]/div[2])')
    # OSS页的Resource Plan Type区按钮标题
    oss_resource_plan_type_btn_tittle = (By.CSS_SELECTOR, '[for="creForm_resourcePlanType"]')
    # OSS页的Capacity按钮标题
    oss_capacity_btn_tittle = (By.CSS_SELECTOR, '[for="creForm_capacity"]')
    # OSS页的Order Setting区标题
    oss_order_setting_tittle = (By.XPATH, '(//*[@id="creForm"]/div[3]/div[1]/div[2])')
    # OSS页的Validity Period区按钮标题
    oss_validity_period_btn_tittle = (By.CSS_SELECTOR, '[for="creForm_period"]')
    # OSS页的Enable Auto-renewal按钮标题
    oss_enable_auto_renewal_btn_tittle = (By.XPATH, '(//*[@for="creForm_autoRenewalFlag"]/div/div[1]/div)')

    # WAF页的Billing Method & Region区标题
    waf_billing_methon_region_tittle = (By.XPATH, '(//*[@id="creForm"]/div[1]/div[1]/div[2])')
    # WAF页Billing Method按钮标题
    waf_billing_methon_tittle = (By.CSS_SELECTOR, '[for="creForm_billingMethod"]')
    # WAF页Region按钮标题
    waf_region_tittle = (By.XPATH, '//*[@class="antd4-row antd4-form-item cre-schema-group"]/div/label/div')
    # WAF页的Domain区标题
    waf_domain_tittle = (By.XPATH, '(//*[@id="creForm"]/div[2]/div[1]/div[2])')
    # WAF页的Domain按钮标题
    waf_domain_btn_tittle = (By.XPATH, '(//*[@for="creForm_capacity"]/div/div[1]/div)')
    # WAF页的Order Setting区标题
    waf_order_setting_tittle = (By.XPATH, '(//*[@id="creForm"]/div[3]/div[1]/div[2])')
    # WAF页的Validity Period区按钮标题
    waf_validity_period_btn_tittle = (By.CSS_SELECTOR, '[for="creForm_period"]')
    # WAF页的Enable Auto-renewal按钮标题
    waf_enable_auto_renewal_btn_tittle = (By.XPATH, '(//*[@for="creForm_autoRenewalFlag"]/div/div[1]/div)')

    # 初始页面展开的tab
    default_page_expanded = (By.CSS_SELECTOR, '[aria-expanded="true"]')

    # Reseller User_tab
    user_management_tab = (By.XPATH, "//div[contains(@data-menu-id,'MANAGEMENT')]")
    # user portal 页面左侧栏的User Management下的Role按钮
    user_management_role_title = (By.CSS_SELECTOR, '[path="/work_bench/role"]')
    # user portal 页面左侧栏的User Management下的User按钮
    user_management_user_title = (By.CSS_SELECTOR, '[path="/work_bench/user"]')
    # user portal 页面左侧栏的User Management下的User Group按钮
    user_management_user_group_title = (By.CSS_SELECTOR, '[path="/work_bench/userGroup"]')

    # user portal的User Management下的Role页面
    user_management_role_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # user portal的User Management下的User页面
    user_management_user_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # user portal的User Management下的User Group页面
    user_management_user_group_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # user portal的User Management下的Role Name
    user_management_role_name = (By.XPATH, '(//div[@class="cre-table-nowrap"])[1]/button/span')

    #  User Management->Role页面的User Name字段
    user_management_user_name_title = (By.XPATH, '(//*[@class="ant-table-column-title"])[2]')
    #  User Management->Role页面的Account Email字段
    user_management_role_account_email_title = (By.XPATH, '(//*[@class="ant-table-column-title"])[1]')
    #  User Management->Role页面的Phone Number字段
    user_management_phone_num_title = (By.XPATH, '(//*[@class="ant-table-column-title"])[3]')
    #  User Management->Role页面的Creation Time (UTC+08:00)字段
    user_management_role_creation_time_title = (By.XPATH, '(//*[@class="ant-table-column-title"])[4]')
    #  User Management->Role页面的Actions字段
    user_management_role_actions_title = (By.XPATH, '(//*[@class="ant-table-wrapper"])/div/div/div/div/div[1]/div/table/thead/tr/th[5]/span/div/span[1]')

    # user portal的User Management下的Role页面的搜索输入框
    user_management_role_search_input = (By.CSS_SELECTOR, '[placeholder="Role Name"]')
    #  user portal的User Management下的Role页面信息搜索按钮
    user_management_role_search_btn = (By.CSS_SELECTOR, '[class="antd4-input-group-addon"]')
    # user portal的User Management下的Role Allocation页面的搜索输入框
    user_management_role_allocation_search_input = (By.CSS_SELECTOR, '[id="creForm_fuzzy"]')
    #  user portal的User Management下的Role Allocation页面信息搜索按钮
    user_management_role_allocation_search_btn = (By.CSS_SELECTOR, '[class="antd4-input-group-addon"]')
    #  user portal的User Management下的Role Allocation页面信息搜索58731有效关键字的结果数据58731@qq.com
    user_management_role_allocation_search_result_data = (By.XPATH, '(//*[@class="antd4-btn antd4-btn-link"])/span')
    # user portal的User Management下的Role Allocation页面成员重置用户密码按钮
    user_management_role_allocation_reset_pwd_btn = (By.XPATH, '(//*[@class="table-operation-btnLine"])[1]/div[1]/button')
    # user portal的User Management下的Role Allocation页面面成员重置用户密码提示弹框
    user_management_role_allocation_reset_pwd_box = (By.CSS_SELECTOR, '[class="antd4-modal-content"]')
    # user portal的User Management下的Role Allocation页面成员重置用户密码提示弹框提示语1  User must agree with you to help reset password.
    user_management_role_allocation_reset_pwd_box_tips1 = (By.XPATH, '//div[@class="main___1Mt3G"]/div/div[1]')
    # user portal的User Management下的Role Allocation页面面成员重置用户密码提示弹框提示语2  New password will be sent to user via selected channel(s).
    user_management_role_allocation_reset_pwd_box_tips2 = (By.XPATH, '//div[@class="main___1Mt3G"]/div/div[2]')
    # user portal的User Management下的Role Allocation页面成员重置用户密码提示弹框的I acknowledge 提示语
    user_management_role_allocation_reset_pwd_acknowledge_tips = (By.XPATH, '//label[@class="antd4-checkbox-wrapper"]/span[2]/span')
    # user portal的User Management下的Role Allocation页面成员重置用户密码提示弹框的I acknowledge 提示勾选按钮
    user_management_role_allocation_reset_pwd_acknowledge_btn = (By.XPATH, '//div[@class="antd4-modal-body"]/div/div[2]/label/span[1]/input')
    # user portal的User Management下的Role Allocation页面成员重置用户密码提示弹框Cancel按钮
    user_management_role_allocation_reset_pwd_cancel_btn = (By.XPATH, '//div[@class="antd4-modal-footer"]/button[1]')
    # user portal的User Management下的Role Allocation页面成员重置用户密码提示弹框的OK按钮
    user_management_role_allocation_reset_pwd_ok_btn = (By.XPATH, '//div[@class="antd4-modal-footer"]/button[2]')
    # user portal的User Management下的Role Allocation页面成员重置用户密码成功的提示语 Reset password successfully.
    user_management_role_allocation_reset_pwd_succcess_tips = (By.XPATH, '//div[@class="antd4-message-notice-content"]/div/span[2]')
    #  user portal的User Management下的Role Allocation页面成员信息页菜单按钮
    role_allocation_member_info_menu_btn = (By.XPATH, '(//*[@class="table-operation"])[1]/div[3]/span')
    #  user portal的User Management下的Role Allocation页面成员信息页菜单Edit User Group按钮
    edit_user_group_btn = (By.XPATH, '(//*[@class="antd4-dropdown-menu-title-content"])[1]')
    #  user portal的User Management下的Role Allocation页面成员信息页菜单Edit Role按钮
    edit_role_btn = (By.XPATH, '(//*[@class="antd4-dropdown-menu-title-content"])[2]')
    #  user portal的User Management下的Role Allocation页面成员信息页菜单Lock按钮
    lock_btn = (By.XPATH, '(//*[@class="antd4-dropdown-menu-title-content"])[3]')
    #  user portal的User Management下的Role Allocation页面成员信息页菜单Unlock按钮
    unlock_btn = (By.XPATH, '(//*[@class="antd4-dropdown-menu-title-content"])[4]')
    #  user portal的User Management下的Role Allocation页面成员信息页菜单Delete按钮
    delete_btn = (By.XPATH, '(//*[@class="antd4-dropdown-menu-title-content"])[5]')
    #  user portal的User Management下的Role Allocation页面成员信息页菜单Resend按钮
    resend_btn = (By.XPATH, '(//*[@class="antd4-dropdown-menu-title-content"])[6]')

    #  User Management->User页面的用户邮箱信息栏
    user_account_email = (By.XPATH, '(//*[@class="antd4-table-tbody"])/tr[2]/td[1]')
    #  User Management->User的用户具体信息页面
    user_member_specific_info_page = (By.CSS_SELECTOR, '[class="cre-page-container-spin"]')
    #  User Management->User的用户具体信息的overview tab
    user_member_info_overview_tab = (By.XPATH, '(//*[@class="antd4-tabs-tab-btn"])[1]')
    #  User Management->User的用户具体信息的User Group tab
    user_member_info_user_group_tab = (By.XPATH, '(//*[@class="antd4-tabs-tab-btn"])[2]')
    #  User Management->User的用户具体信息的Audit tab
    user_member_info_audit_tab = (By.XPATH, '(//*[@class="antd4-tabs-tab-btn"])[3]')
    #  User Management->User的用户具体信息的overview tab的基本信息页Basic Information标题
    user_member_basic_info_overview_title = (By.CSS_SELECTOR, '[class="antd4-descriptions-title"]')
    #  User Management->User的用户具体信息的User Group tab的基本信息页User Group字段
    user_member_info_user_group_field = (By.XPATH, '(//*[@class="antd4-table-cell"])[1]')
    #  User Management->User的用户具体信息的User Group tab的基本信息页Members字段
    user_member_info_members_field = (By.XPATH, '(//*[@class="antd4-table-cell"])[2]')
    #  User Management->User的用户具体信息的Audit tab的基本信息页Account Email字段
    user_member_info_audit_account_email_field = (By.XPATH, '(//*[@class="antd4-table-cell"])[1]')
    #  User Management->User的用户具体信息的Audit tab的基本信息页Event Type字段
    user_member_info_audit_event_type_field = (By.XPATH, '(//*[@class="antd4-table-cell"])[2]/div/span')
    #  User Management->User的用户具体信息的Audit tab的基本信息页Remarks字段
    user_member_info_audit_remarks_field = (By.XPATH, '(//*[@class="antd4-table-cell"])[5]')

    #  User Management->User Group页面字段Account Email
    user_group_account_email = (By.XPATH, '//*[@class="antd4-table-content"]/table/thead/tr/th[1]')
    #  User Management->User Group页面字段Status
    user_group_status = (By.XPATH, '//*[@class="antd4-table-content"]/table/thead/tr/th[2]/div/span[1]')
    #  User Management->User Group页面字段User Name
    user_group_user_name = (By.XPATH, '//*[@class="antd4-table-content"]/table/thead/tr/th[3]')
    #  User Management->User Group页面字段Phone Number
    user_group_phone_number = (By.XPATH, '//*[@class="antd4-table-content"]/table/thead/tr/th[4]')
    #  User Management->User Group页面字段Creation Time (UTC+08:00)
    user_group_creation_time = (By.XPATH, '//*[@class="antd4-table-content"]/table/thead/tr/th[5]')
    #  User Management->User Group页面字段Actions
    user_group_actions = (By.XPATH, '//*[@class="antd4-table-content"]/table/thead/tr/th[6]')





